<%= tr8n_paginator_tag(translations, :subject => 'translation') if mode == :list and translations.any? %>	

<table style="width:100%;" cellpadding="5px" cellspacing="3px">
  <tr style="border-bottom:1px solid #ccc;">
    <td class="tr8n_txtl" style="width:200px;"><%=tra("Translator")%></td>
    <td class="tr8n_txtl" style="width:25px;"><%=tra("Rank")%></td>
    <td style="width:80px;text-align:center"><%=tra("Your Vote")%></td>
    <td class="tr8n_txtl"><%=tra("Translation")%></td>
    <% if [:view, :edit].include?(mode) %> 
      <td class="topic_header" style="width:50px;">&nbsp;</td>
		<% end %>
  </tr>  

  <% translations.each do |trn| %>
    <% style = "border-bottom:1px dotted #ccc;" unless translations.last == trn %>
    <tr style="<%=style%>" id="translation_row_<%=trn.id%>">
			 <%= render :partial => "/tr8n/translations/translation", :locals => {:language => language, :translation => trn, :mode => mode} %>
    </tr>
  <% end %>
</table>

<% if translations.empty? %>
    <div class="tr8n_txtl" style="padding-top:10px; font-size:12px;"><%=trla("No translations found")%></div>
<% end %>

<%= tr8n_paginator_tag(translations, :subject => 'translation') if mode == :list and translations.any? %>	

<% if [:edit, :view].include?(mode) %>
	<script>
	  function deleteTranslationRow(translation_id, section_key) {
	    if (!confirm("<%=trl('Are you sure you want to delete this translation?')%>")) {
	      return;
	    }
	    
	    Tr8n.Effects.hide('tr8n_votes_for_' + translation_id);
	    Tr8n.Effects.show('tr8n_spinner_for_' + translation_id);
	    location = "/tr8n/translations/delete?translation_id=" + translation_id + "&section_key=" + section_key;
	  }
	  
	  function updateTranslationRow(translation_id, mode) {
	    Tr8n.Effects.hide('tr8n_votes_for_' + translation_id);
	    Tr8n.Effects.show('tr8n_spinner_for_' + translation_id);
	    
      Tr8n.Utils.update('translation_row_' + translation_id, '/tr8n/translations/update', {
        evalScripts: true,
        parameters: "translation_id=" + translation_id + "&mode=" + mode
      });
	  }
	  
	  function submitTranslationRow(translation_id) {
	    Tr8n.Effects.hide('tr8n_votes_for_' + translation_id);
	    Tr8n.Effects.show('tr8n_spinner_for_' + translation_id);
	    
      Tr8n.Utils.update('translation_row_' + translation_id, '/tr8n/translations/update', {
        evalScripts: true,
        parameters: {translation_id: translation_id, label: Tr8n.value("translation_row_value_" + translation_id)},
        method: 'post'
      });
	  }
	</script>
<% end %>